/*
 * @Descripttion:
 * @version:
 * @Author: congsir
 * @Date: 2025-10-25 22:57:09
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2025-11-02 22:39:00
 */
import React, { Suspense } from 'react'
import { useRoutes } from 'react-router-dom'

import routes from '@/router/index'
// import { useAppSelector, useAppDispatch, shallowEqualApp } from './store'
// import { changeMessageAction } from './store/module/counter'
import AppHeader from '@/components/app-header'
import AppFooter from '@/components/app-footer'
function App() {
  // const { count, message } = useAppSelector(
  //   (state) => ({
  //     //state这个ts的useAppSelector的调用签名对state做了类型校验
  //     count: state.counter.count,
  //     message: state.counter.message
  //   }),
  //   shallowEqualApp //浅比较，未变化的不会发生更新
  // )

  // const dispatch = useAppDispatch()
  // const handleChange = () => {
  //   dispatch(changeMessageAction('你好'))
  // }
  return (
    <div className="App">
      <div className="app_header">
        <AppHeader />
      </div>
      <Suspense fallback="">
        <div>{useRoutes(routes)}</div>
      </Suspense>
      <div className="app_footer">
        <AppFooter />
      </div>
    </div>
  )
}

export default App
